<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("admin.file.list")}</title>


<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" /><link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script> <script type="text/javascript" src="${base}/resources/admin/js/amazeui.min.js"></script>
<script type="text/javascript">
$().ready(function() {
	var $delete = $("#listTable a.delete");
	[@flash_message /]
	// 删除
	$delete.click(function() {
		var $this = $(this);
		$.dialog({
			type: "warn",
			content: "${message("admin.dialog.deleteConfirm")}",
			onOk: function() {
				$.ajax({
					url: "/asl-admin/storage_plugin/file/del.action",
					type: "POST",
					data: {filename: $this.attr("val")},
					dataType: "json",
					cache: false,
					success: function(message) {
						//$.message(message);
						if (message.type == "success") {
							$this.closest("tr").hide(1000);
						}
					}
				});
			}
		},260,180);
		return false;
	});
});
</script>
<style>
table.list td{
	line-height:60px;
}
table.list td img{
	height:55px;
}
</style>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; ${message("admin.file.list")}
	</div>
	<form id="listForm" action="list.htm" method="get">
		<div class="bar">
			<a href="add.htm" class="iconButton" id="addButton">
				<i class="iconfont icon-anonymous-iconfont1">&nbsp;</i>${message("admin.common.add")}
			</a>
			<div class="buttonWrap">
				<a href="javascript:" id="deleteButton" class="iconButton disabled">
					<i class="iconfont icon-icon27">&nbsp;</i>${message("admin.common.delete")}
				</a>
				<a href="javascript:" id="refreshButton" class="iconButton">
					<i class="iconfont icon-shuaxin1">&nbsp;</i>${message("admin.common.refresh")}
				</a>
			</div>
			<a href="/asl-admin/storage_plugin/file/list.htm?path=/" class="iconButton">
				<span class="refreshIcon">&nbsp;</span>${message("admin.common.lastview")}
			</a>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check">
					<input type="checkbox" id="selectAll" />
				</th>
				<th>
					<a href="javascript:" class="sort" name="name">${message("File.name")}</a>
				</th>
				<th>
					<a href="javascript:" class="sort" name="productCategory">${message("File.size")}</a>
				</th>
				<th>
					<span>${message("File.url")}</span>
				</th>
				<th>
					<span>${message("admin.common.handle")}</span>
				</th>
			</tr>
			[#list files as file]
				<tr>
					<td>
						<input type="checkbox" name="ids" value="${file.id}" />
					</td>
					<td>
						[#if file.isDirectory]
							<a href="/asl-admin/storage_plugin/file/list.htm?path=/${file.name}/">${file.name}</a>
						[#else]
							${file.name}
						[/#if]
					</td>
					<td>
						[#if file.isDirectory]
							目录
						[#else]
							${file.size}
						[/#if]
					</td>
					<td>
						${file.url} 
						[#if file.isDirectory]
						[#else]
							<img src="${file.url}"/>
						[/#if]
					</td>
					<td>
						[#if file.isDirectory]
						[#else]
							<a val="${file.name}" href="javascript:" class="delete"><i class="iconfont icon-shequshanchu del-icon" ></i></a>
						[/#if]
					</td>
				</tr>
			[/#list]
		</table>
	</form>
</body>
</html>